home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / ENETDUMP.C < prev    next >
C/C++ Source or Header  |  1988-04-03  |  639b  |  35 lines

  1. #include <stdio.h>
  2. #include "global.h"
  3. #include "mbuf.h"
  4. #include "enet.h"
  5. #include "trace.h"
  6.  
  7. extern FILE *trfp;
  8.  
  9. ether_dump(bpp,check)
  10. struct mbuf **bpp;
  11. int check;    /* Not used */
  12. {
  13.     struct ether ehdr;
  14.     char s[20],d[20];
  15.  
  16.     ntohether(&ehdr,bpp);
  17.     pether(s,ehdr.source);
  18.     pether(d,ehdr.dest);
  19.     fprintf(trfp,"Ether: len %u %s->%s",ETHERLEN + len_mbuf(*bpp),s,d);
  20.  
  21.     switch(ehdr.type){
  22.         case IP_TYPE:
  23.             fprintf(trfp," type IP\n");
  24.             ip_dump(bpp,1);
  25.             break;
  26.         case ARP_TYPE:
  27.             fprintf(trfp," type ARP\n");
  28.             arp_dump(bpp);
  29.             break;
  30.         default:
  31.             fprintf(trfp," type 0x%x\n",ehdr.type);
  32.             break;
  33.     }
  34. }
  35.